package org.eiahe.hr.attendance.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.ehe.common.core.validate.AddGroup;
import org.ehe.common.core.validate.EditGroup;
import org.ehe.common.mybatis.core.domain.BaseEntity;
import org.eiahe.hr.attendance.domain.EmployeeAttendanceType;

import java.time.LocalDate;
import java.util.List;

/**
 * 员工考勤类型业务对象 hr_employee_attendance_type
 *
 * @author zhangnn
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = EmployeeAttendanceType.class, reverseConvertGenerate = false)
public class EmployeeAttendanceTypeBo extends BaseEntity {

    /**
     * 员工考勤类型ID
     */
    @NotNull(message = "员工考勤类型ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 工号
     */
    @NotBlank(message = "工号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String employeeNo;

    private String employeeName;

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long userId;

    /**
     * 考勤类型ID
     */
    @NotNull(message = "考勤类型ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long typeId;

    /**
     * 生效日期
     */
    @NotNull(message = "生效日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate effectiveDate;

    /**
     * 失效日期(NULL表示永久有效)
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate expiryDate;

    /**
     * 状态(0-失效 1-生效)
     */
    private String status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 员工ID列表(批量分配时使用)
     */
    private List<Long> employeeIds;

    /**
     * 工号列表(批量分配时使用)
     */
    private List<String> employeeNos;
}
